#列表
'''
数据序列
如
a_list = [1,2,3,4,'this','']
a_list = list('1','dsh',1,4,2,'')
a_list = list('hello')
a_list = list(range(1,101,2))

'''

#元素访问
'''
如
a_list=[1,2,3,4,'this','is','a','simple','example']
下标从0开始a_list[1]
负数表示倒过来计数a_list[-2]
切片a_list[1:3]
a_list[1:]

'''

a_list=[1,2,3,4,'this','is','a','simple','example']
print(a_list[2])#3
print(a_list[-2])#simple
print(a_list[1:3])#2,3
print(a_list[3:])#4,'this','is','a','simple','example'

#列表遍历

#1
for x in a_list:
  print(x)


#2
for i in range(len(a_list)):
  print(a_list[i])
